package com.edu.whty.config;

import com.edu.whty.interceptor.BigDataInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private BigDataInterceptor bigDataInterceptor;
	

	@Override
	public void addInterceptors(InterceptorRegistry registry) {

		registry.addInterceptor(bigDataInterceptor).addPathPatterns("/cloud/saveCloudRes");
		registry.addInterceptor(bigDataInterceptor).addPathPatterns("/cloud/deleteCloud");

	}

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
	}


	
}
